load("//tools:defaults.bzl", "js_binary", "ts_config", "ts_project")

package(default_visibility = ["//visibility:public"])

ts_config(
    name = "tsconfig_build",
    src = "tsconfig.json",
    deps = ["//tools:tsconfig_build"],
)

ts_project(
    name = "generate_element_api_json_lib",
    srcs = ["generate_element_api_json.mts"],
    tsconfig = ":tsconfig_build",
    deps = [
        "//:node_modules/@types/node",
        "//packages/compiler-cli/src/ngtsc/docs",
    ],
)

js_binary(
    name = "generate_element_api_json",
    data = [
        ":generate_element_api_json_lib",
    ],
    entry_point = ":generate_element_api_json.mjs",
)

ts_project(
    name = "generate_block_api_json_lib",
    srcs = ["generate_block_api_json.mts"],
    tsconfig = ":tsconfig_build",
    deps = [
        "//:node_modules/@types/node",
        "//packages/compiler-cli/src/ngtsc/docs",
    ],
)

js_binary(
    name = "generate_block_api_json",
    data = [
        ":generate_block_api_json_lib",
    ],
    entry_point = ":generate_block_api_json.mjs",
)
